﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebFormFamilia.aspx.cs" Inherits="Sitio.WebFormFamilia" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
 <link href ="estilo.css"  rel="Stylesheet" type="text/css" />
    <title></title>
    <style type="text/css">

        .style2
        {
            height: 26px;
            width: 251px;
        }
        .style1
        {
            font-size: medium;
        }
        </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <div>
            <strong style="font-size: large">FAMILIAS<br />
            </strong>
            <asp:Label ID="lblMensaje" runat="server" 
                style="font-weight: 700; color: #0033CC; font-size: large;"></asp:Label>
            <br />
            <br />
            <asp:Button ID="btnNuevo" runat="server" onclick="btnNuevo_Click" 
                Text="Nuevo" style="font-size: medium" />
            &nbsp;&nbsp;
            <asp:Button ID="btnBuscar" runat="server" onclick="btnBuscar_Click" 
                Text="Buscar" style="font-size: medium" />
            &nbsp;
            <asp:Button ID="btRegresar" runat="server" onclick="btRegresar_Click" 
                style="font-size: medium" Text="Regresar" />
&nbsp;<asp:Panel ID="pnlNuevo" runat="server">
                <table style="width: 100%;">
                    <tr>
                        <td class="style1">
                            &nbsp;</td>
                        <td class="style3">
                            <asp:TextBox ID="txtCodigo" runat="server" Enabled="False" Width="33px" 
                                Visible="False"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Nombre:</td>
                        <td class="style3">
                            <asp:TextBox ID="txtNombre" runat="server" Width="185px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ControlToValidate="txtNombre" ErrorMessage="RequiredFieldValidator" 
                                ValidationGroup="Validar">Ingrese Nombre</asp:RequiredFieldValidator>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Depreciación:</td>
                        <td class="style3">
                            <asp:TextBox ID="txtDepreciacion" runat="server" Width="73px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ControlToValidate="txtDepreciacion" ErrorMessage="RequiredFieldValidator" 
                                ValidationGroup="Validar">Ingrese Depreciacion</asp:RequiredFieldValidator>
                            &nbsp;<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                ControlToValidate="txtDepreciacion" ErrorMessage="RegularExpressionValidator" 
                                ValidationGroup="Validar" 
                                ValidationExpression="[0-9]{1,9}(\.[0-9]{0,2})?$">Inserte solo numeros</asp:RegularExpressionValidator>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                    <td class="style1">
                            Descripcion:</td>
                        <td class="style3">
                            <asp:TextBox ID="txtdescripcion" runat="server" Width="185px"></asp:TextBox>
                            &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                ControlToValidate="txtdescripcion" ErrorMessage="RequiredFieldValidator" 
                                ValidationGroup="Validar">Ingrese Descripcion</asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                                ControlToValidate="txtdescripcion" ErrorMessage="RegularExpressionValidator" 
                                ValidationExpression="[a-zA-ZñÑ\s]{2,50}" ValidationGroup="Validar">Ingrese Letras</asp:RegularExpressionValidator>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style1">
                            &nbsp;</td>
                        <td class="style3">
                            <asp:Button ID="btnGuardar" runat="server" onclick="btnGuardar_Click" 
                                Text="Guardar" style="font-size: medium" ValidationGroup="Validar" />
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="pnlBuscar" runat="server">
                <strong><span class="style2">
                <br />
                </span></strong>
                <i><b>
                <asp:Label ID="lblMensaje0" runat="server" Font-Size="Large" ForeColor="Red"></asp:Label>
                </b></i><strong>
                <br />
                Resultados<br /> </strong></span>
                <asp:GridView ID="grdFamilias" runat="server" AutoGenerateColumns="false" 
                    onrowcommand="ResultGrid_RowCommand" 
                    onselectedindexchanged="grdFamilias_SelectedIndexChanged" Width="500px">
                    <EmptyDataTemplate>
                        No se encontraron resultados para la busqueda.
                    </EmptyDataTemplate>
                    <Columns>
                        <asp:BoundField DataField="id" HeaderText="Codigo" Visible="false" />
                        <asp:TemplateField HeaderText="Eliminar">
                            <ItemTemplate>
                                <asp:BUTTON ID="Delete" runat="server" 
                                    CommandArgument='<%# DataBinder.Eval(Container.DataItem,"LFAMILIA_ID1") %>' 
                                    CommandName="Eliminar"  />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Editar">
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                               <asp:BUTTON ID="Edit" runat="server" 
                                    CommandArgument='<%# DataBinder.Eval(Container.DataItem,"LFAMILIA_ID1") %>' 
                                    CommandName="Editar"/>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="SNOMBRE1" HeaderText="NOMBRE" />
                        <asp:BoundField DataField="SDESCRIPCION1" HeaderText="DESCRIPCION" />
                         <asp:BoundField DataField="LDEPRECIACION1" HeaderText="DEPRECIACION" />
                    </Columns>
                </asp:GridView>
            </asp:Panel>
            <br />
        </div>
    
    </div>
    </form>
</body>
</html>
